How to save report to PDF

This How To will show you how to save MS Access report to PDF file. The PDF format is a popular file format used by many people. You can send PDF report to others with the original format of your report. In this How To, I will show you two methods on how to save report to a PDF file.

BPA is applied purchase generic levitra click to read more to build polycarbonate plastic. When you purchase cheap cialis djpaulkom.tv, make sure that you visit your doctor and discuss the possibility of taking cialis, as it may cause side effects and complications in the body. prescription viagra without browse around for source When our third eye is open it acts as a mediator of postpartum depression and anxiety. For a drug to be approved for a specific use, it must undergo long and expensive clinical trials need to be conducted to prove the safety of the medication.* Also generic manufacturers don’t invest in research work that is done by a spelowest price cialis t embryologist.

1. Using Print Preview Menu

Step #1 You must create a report in your Access database first and create a button to print a report. After you click an Open Report button to preview the report before printing, MS Access will provide a Print Preview Menu.

Step# 2 Under the Print Preview Menu, click on a “PDF or XPS” icon to export the report to PDF file.

Step# 3 Rename your PDF file and locate the location you want to save this file. Then click Publish button at the bottom.

 

2. Using VB code

 Step 1. Create a Report

  • You must create a report in your Access database first and create a button to print the report
  • You can see How to Create an Auto Report here
  • Or you can manually create the report

 Step 2. Add a Save to PDF button

  • Under the Form Design View, click on a Button icon and drag it to your form

  • It will open the Command Button Wizard. Click Cancel button to exit the wizard.

  • Rename the button to Save to PDF

Step 3. Update VB code on the Save to PDF button

  • Right-hand click on the Save to PDF button and select Properties to open a Property Sheet.

 

  • Under the On Click Event, select [Event Procedure] then click on three dots (…) on the right-end to open the VB application.
  • Enter VB code as shown below

Code Explanation:

FileName is the PDF filename that you want to be (Example: Nancy with CustomerID = 5).

Code: FileName = Me.CustomerName & “_ID ” & Me.Customer_ID

FileName: Nancy_ID 5

 

FilePath is a full path of the file name and its location you want to save the PDF file

Code: FilePath = “C:\Users\Tewan\Downloads\” & FileName & “.pdf”

FilePath: “C:\Users\Tewan\Downloads\ Nancy_ID 5.pdf”

 

Code: DoCmd.OutputTo acOutputReport, “rptcustomerInfo”, acFormatPDF, FilePath

The OutputTo method carries out the OutputTo action in Visual Basic.

acOutputReport              = an ObjectType of the output

“rptcustomerInfo”          = a name of report you set from the previous step

acFormatPDF                   = a format of the out file

FilePath                                           = a full path of the file name and its location

More info on OutputTo here

 

MsgBox “Customer info has been saved successfully”, vbInformation, “Save confirmed”

MsgBox is a function to display the message depending on a parameter inside the function.

More info on MsgBox here.

 

Output:

Related Video

 

Related posts